﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ProjectWebNhac.BUS;

namespace ProjectWebNhac.GUI.Admin
{
    public partial class Index : System.Web.UI.MasterPage
    {
        AdminBus adbus = new AdminBus();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                if (Session["Admin"] == null || Session["Admin"] == "")
                    Response.Redirect("Login.aspx");
                else
                    loadtrang();
            }
        }

        private void loadtrang()
        {
            lbThanhVienMoi.Text = adbus.loadsothanhvienmoidangky().ToString();
            reDSThanhVienMoiDK.DataSource = adbus.loadthanhvienmoidk();
            reDSThanhVienMoiDK.DataBind();

            lbSoBaiHatMoi.Text = adbus.loadsobaihatmoithem().ToString();
            reBaiHatMoiThem.DataSource = adbus.loadaihatnmoithem();
            reBaiHatMoiThem.DataBind();

            string TaiKhoan = Session["Admin"].ToString();
            adbus.capnhattimeoutadmin(TaiKhoan);
        }
    }
}